package com.lightboat.system.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.Fastjson2TypeHandler;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.lightboat.common.annotation.Excel;
import com.lightboat.common.core.domain.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.media.SchemaProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 物流轨迹日志对象 crm_logistics_track
 * 
 * @author lightboat
 * @date 2025-08-30
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Schema(title = "物流轨迹日志")
@TableName(value = "crm_logistics_track", autoResultMap = true)
public class CrmLogisticsTrack extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /** 主键ID */
    @SchemaProperty(name = "主键ID")
    @TableId
    private Long trackId;

    /** 订单编号 */
    @SchemaProperty(name = "订单编号")
    @Excel(name = "订单编号")
    private String orderNo;

    /** 客户订单编号（三方平台订单号，长度为1-100字符） */
    @SchemaProperty(name = "客户订单编号（三方平台订单号，长度为1-100字符）")
    @Excel(name = "客户订单编号", readConverterExp = "三=方平台订单号，长度为1-100字符")
    private String customerOrderNo;

    /** 物流单号（运单号，长度为1-100字符） */
    @SchemaProperty(name = "物流单号（运单号，长度为1-100字符）")
    @Excel(name = "物流单号", readConverterExp = "运=单号，长度为1-100字符")
        private String waybillNo;

    /** 操作人姓名（长度为1-20字符） */
    @SchemaProperty(name = "操作人姓名（长度为1-20字符）")
    @Excel(name = "操作人姓名", readConverterExp = "长=度为1-20字符")
    private String operatorName;

    /** 操作时间（格式：yyyy-MM-dd HH:mm:ss） */
    @SchemaProperty(name = "操作时间（格式：yyyy-MM-dd HH:mm:ss）")
    @Excel(name = "操作时间", readConverterExp = "格=式：yyyy-MM-dd,H=H:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date operationTime;

    /** 操作节点阶段（长度为1-20字符，参考文档：http://cloud.jdl.com/#/open-business-document/access-guide/469/55221） */
    @SchemaProperty(name = "操作节点阶段（长度为1-20字符，参考文档：http://cloud.jdl.com/#/open-business-document/access-guide/469/55221）")
    @Excel(name = "操作节点阶段", readConverterExp = "长=度为1-20字符，参考文档：http://cloud.jdl.com/#/open-business-document/access-guide/469/55221")
    private String operationType;

    /** 操作节点状态（长度为1-20字符，参考文档：http://cloud.jdl.com/#/open-business-document/access-guide/469/55221） */
    @SchemaProperty(name = "操作节点状态（长度为1-20字符，参考文档：http://cloud.jdl.com/#/open-business-document/access-guide/469/55221）")
    @Excel(name = "操作节点状态", readConverterExp = "长=度为1-20字符，参考文档：http://cloud.jdl.com/#/open-business-document/access-guide/469/55221")
    private String operationCode;

    /** 操作站点（长度为1-100字符） */
    @SchemaProperty(name = "操作站点（长度为1-100字符）")
    @Excel(name = "操作站点", readConverterExp = "长=度为1-100字符")
    private String operateSite;

    /** 操作站点ID（长度为1-100字符） */
    @SchemaProperty(name = "操作站点ID（长度为1-100字符）")
    @Excel(name = "操作站点ID", readConverterExp = "长=度为1-100字符")
    private String operateSiteId;

    /** 路由省份名称（长度为1-20字符） */
    @SchemaProperty(name = "路由省份名称（长度为1-20字符）")
    @Excel(name = "路由省份名称", readConverterExp = "长=度为1-20字符")
    private String routeProvinceName;

    /** 路由城市名称（长度为1-20字符） */
    @SchemaProperty(name = "路由城市名称（长度为1-20字符）")
    @Excel(name = "路由城市名称", readConverterExp = "长=度为1-20字符")
    private String routeCityName;

    /** 路由区县名称（长度为1-20字符） */
    @SchemaProperty(name = "路由区县名称（长度为1-20字符）")
    @Excel(name = "路由区县名称", readConverterExp = "长=度为1-20字符")
    private String routeDistrictName;

    /** 路由街道名称（长度为1-20字符） */
    @SchemaProperty(name = "路由街道名称（长度为1-20字符）")
    @Excel(name = "路由街道名称", readConverterExp = "长=度为1-20字符")
    private String routeStreetName;

    /** 扩展信息（JSON格式存储），包括取消原因、签收类型等 */
    @SchemaProperty(name = "扩展信息（JSON格式存储），包括取消原因、签收类型等")
    @Excel(name = "扩展信息", readConverterExp = "J=SON格式存储")
    @TableField(typeHandler = Fastjson2TypeHandler.class)
    private String extendInfo;

    /** 货物体积（单位：cm³，顺丰专用） */
    @SchemaProperty(name = "货物体积（单位：cm³，顺丰专用）")
    @Excel(name = "货物体积", readConverterExp = "单=位：cm³，顺丰专用")
    private BigDecimal cargoVolume;

    /** 货物重量（单位：kg，顺丰专用） */
    @SchemaProperty(name = "货物重量（单位：kg，顺丰专用）")
    @Excel(name = "货物重量", readConverterExp = "单=位：kg，顺丰专用")
    private BigDecimal cargoWeight;

    /** 货物数量（顺丰专用） */
    @SchemaProperty(name = "货物数量（顺丰专用）")
    @Excel(name = "货物数量", readConverterExp = "顺=丰专用")
    private Long cargoAmount;

    /** 物流公司编号 */
    @SchemaProperty(name = "物流公司编号")
    @Excel(name = "物流公司编号")
    private String logisticsNo;

    /** 物流公司名称 */
    @SchemaProperty(name = "物流公司名称")
    @Excel(name = "物流公司名称")
    private String logisticsName;

    @SchemaProperty(name = "状态（长度为1-20字符，参考文档：https://open.jdl.com/#/open-business-document/access-guide/267/54018）")
    /** 状态（长度为1-20字符，参考文档：https://open.jdl.com/#/open-business-document/access-guide/267/54018） */
    private String state;

    /** 节点描述，长度1-100 */
    @SchemaProperty(name = "节点描述，长度1-100")
    private String operationRemark;

    /** 取消原因（长度为1-100字符） */
    @SchemaProperty(name = "取消原因（长度为1-100字符）")
    private String cancelReason;

    /** 路由详细地址；站点的地址，长度1-200） */
    @SchemaProperty(name = "路由详细地址；站点的地址，长度1-200）")
    private String routeAddress;




    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("trackId", getTrackId())
            .append("orderNo", getOrderNo())
            .append("customerOrderNo", getCustomerOrderNo())
            .append("waybillNo", getWaybillNo())
            .append("remark", getRemark())
            .append("operatorName", getOperatorName())
            .append("operationTime", getOperationTime())
            .append("operationType", getOperationType())
            .append("operationCode", getOperationCode())
            .append("operateSite", getOperateSite())
            .append("operateSiteId", getOperateSiteId())
            .append("routeProvinceName", getRouteProvinceName())
            .append("routeCityName", getRouteCityName())
            .append("routeDistrictName", getRouteDistrictName())
            .append("routeStreetName", getRouteStreetName())
            .append("extendInfo", getExtendInfo())
            .append("cargoVolume", getCargoVolume())
            .append("cargoWeight", getCargoWeight())
            .append("cargoAmount", getCargoAmount())
            .append("logisticsNo", getLogisticsNo())
            .append("logisticsName", getLogisticsName())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .toString();
    }
}
